#include "glad/glad.h"
#include <QOpenGLFunctions>

#include "RenderCommand.h"

#include "OpenGL/OpenGLRendererAPI.h"

namespace Cogs {
#if defined OPENGL_RENDERER
	std::shared_ptr<RendererAPI> RenderCommand::s_RendererAPI = std::make_shared<OpenGLRendererAPI>();
	void InitialRendererContext() {
		if (!gladLoadGLLoader([](const char* name) -> void* {
			return (void*)QOpenGLContext::currentContext()->getProcAddress(name);
			})) {
			qDebug() << "Failed to initialize GLAD";
		}
	}
#elif defined D3D_RENDERER
	std::shared_ptr<RendererAPI> RenderCommand::s_RendererAPI = std::make_shared<DireceX12RendererAPI>();
#elif defined VULKAN_RENDERER
	std::shared_ptr<RendererAPI> RenderCommand::s_RendererAPI = std::make_shared<VulkanRendererAPI>();
#else
	#error "No rendering backend defined! Please define one of: OPENGL_RENDERER, D3D_RENDERER, VULKAN_RENDERER"
#endif // OPENGL_RENDERER


	
}